<?php

/**
 * WeEngine System
 *
 * (c) We7Team 2021 <https://www.w7.cc>
 *
 * This is not a free software
 * Using it under the license terms
 * visited https://www.w7.cc for more details
 */

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Itwmw\Validate\Attributes\ValidateAttributesFactory;
use Itwmw\Validate\Middleware\ValidateMiddlewareConfig;
use W7\Validate\Support\Storage\ValidateConfig;

class ValidateServiceProvider extends ServiceProvider
{
    public function register()
    {
        ValidateConfig::instance()
            ->setRulesPath('App\\Http\\Validator\\Rules\\');

        ValidateMiddlewareConfig::instance()
            ->setAutoValidatePath('App\\Http\\Controllers\\', 'App\\Http\\Validator\\')
            ->setValidateFactory(new ValidateAttributesFactory());
    }
}
